<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
	String path = request.getContextPath();
%>
<html>
  <head>
  <script type="text/javascript">
function beforeSubmit(obj){
	var fileName = obj.value;
	var extend = fileName.substring(fileName.lastIndexOf( ".") + 1, fileName.length);
	extend = extend.toLowerCase(); 
	if(fileName==""){
		alert("请选择导入文件路径");
		return false;
	}else if(extend != "txt"){
		alert("必须导入txt格式的文件");
		return false;
	}else{
		$("#upload_file_button").attr("disabled", false);
	}
	return true;
}
function processUploadResult(args) {
	if(args["result"] != "success"){
		 alertMsg.error('上传失败');
	}else{
		alertMsg.correct('操作成功');
		$.pdialog.closeCurrent();	
		navTab.reloadFlag(args["refreshNavTabId"]);
		navTabPageBreak();
	}
}
</script>
    <title>upload</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
	<div class="pageContent">
		<form method="post" action="<%=path %>/regioninfo/importRegionInfo.action" enctype="multipart/form-data" class="pageForm required-validate" onsubmit="iframeCallback(this,processUploadResult);">
			<div class="pageFormContent" layoutH="56">
				<p>
					<label>文件（txt格式）：</label>
					<input name="importFile" type="file" accept="txt" onchange="beforeSubmit(this);"/>
				</p>
			</div>
			<div class="formBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button id="upload_file_button" type="submit" disabled="disabled">导入</button></div></div></li>
					<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
				</ul>
			</div>
		</form>
	</div>
  </body>
</html>
